package cn.itlaobing.springmvc.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.itlaobing.springmvc.dao.AccountMapper;
import cn.itlaobing.springmvc.entity.Account;
import cn.itlaobing.springmvc.service.AccountService;
@Service
public class AccountServiceImpl implements AccountService {
	
	@Autowired
	private AccountMapper accountMapper;

	@Override
	public Account validateAcc(String username,String userpass) {
		
	Account account = accountMapper.selectByAccount(username);
	if (account==null) {
		return account;
	}
	String relPass=account.getPassword();
	if (relPass.equals(userpass)) {
		return account;
	}
	
	
	
		return null;
	}

}
